/**
 * OWASP GoatDroid Project
 * 
 * This file is part of the Open Web Application Security Project (OWASP)
 * GoatDroid project. For details, please see
 * https://www.owasp.org/index.php/Projects/OWASP_GoatDroid_Project
 *
 * Copyright (c) 2011 - The OWASP Foundation
 * 
 * GoatDroid is published by OWASP under the GPLv3 license. You should read and accept the
 * LICENSE before you use, modify, and/or redistribute this software.
 * 
 * @author Jack Mannino, nVisium Security (https://www.nvisiumsecurity.com)
 * @created 2011
 */
package org.owasp.goatdroid.fourgoats.webservice.resources;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.CookieParam;
import javax.ws.rs.QueryParam;
import org.owasp.goatdroid.fourgoats.webservice.Constants;
import org.owasp.goatdroid.fourgoats.webservice.venues.VenuesImpl;
import org.owasp.goatdroid.fourgoats.webservice.venues.beans.VenueListBean;
import org.owasp.goatdroid.fourgoats.webservice.venues.beans.VenuesBean;

@Path("/fourgoats/api/v1/venues")
public class Venues {

	@Path("add")
	@GET
	@Produces("application/json")
	public VenuesBean addVenue(
			@CookieParam(Constants.SESSION_TOKEN_NAME) String sessionToken,
			@QueryParam("venueName") String venueName,
			@QueryParam("venueWebsite") String venueWebsite,
			@QueryParam("latitude") String latitude,
			@QueryParam("longitude") String longitude) {

		return VenuesImpl.addVenue(sessionToken, venueName, venueWebsite,
				latitude, longitude);
	}

	@Path("list")
	@GET
	@Produces("application/json")
	public VenueListBean getAllVenues(
			@CookieParam(Constants.SESSION_TOKEN_NAME) String sessionToken) {

		return VenuesImpl.getAllVenues(sessionToken);

	}
}
